package cn.jzq.kotoba.modules.spring.ioc.demo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jzq
 * @date 2019/4/12 8:20
 */
@RestController
@RequestMapping("/test/user")
public class UserController {
    private UserService userService;

    public UserController () {
        this.userService = new UserServiceImpl();
    }

    @GetMapping("/{id}")
    public UserEntity getUserById(@PathVariable("id")Integer id) {
        return userService.getUserById(id);
    }
}
